Summary Crystallography is an indispensable tool in modern structural biology, allowing for precise determination of molecular interactions in proteins. The majority of the computational crystallographic tools available have been developed on the prerequisite that the diffraction data is free from pathologies such as twinning. For the detection of twinned data and refinement of structures, excellent software is already available, but for more upstream tasks, no general? purpose tools are available. The absence of tools that allow handling of twinned data has resulted in practical difficulties when solving structures from such data. This proposal addresses this critical gap by developing twinning?aware tools and algorithms for all mainstream crystallographic tasks for which no such tools exist. We propose to adopt and extend existing density modification and heavy atom determination methods such that they are suited for handling twinned data. The proposed algorithm propagates vital prior information from real space all the way into data space, numerically stabilizing an otherwise ill?conditioned detwinning step using a regularization approach. To provide the community with a full complement of tools for de novo phasing, heavy atom refinement and phasing strategies will be addressed by developing and evaluating numerical techniques needed for the twinned?SAD likelihood function. This problem will be addressed using an adaptive quadrature approach.